#ifndef PM_COST_EVOLUTION_H_INCLUDED
#define PM_COST_EVOLUTION_H_INCLUDED

#include "pm/dbobject.h"
#include "pm/criteria.h"
#include <vector>

namespace pm
{

/**
 * \class CostEvolution
 */
class CostEvolution : public db::Object
{
public:
	struct Month {
		db::real work_request;
		db::real cost;
		db::real todo;
		db::text month;
	};
	
	typedef std::vector<Month> VectorMonth;
	
private:
	VectorMonth  m_months;
	
public:
	CostEvolution();
	
	const VectorMonth& get() const { return m_months; }
	
	virtual bool load(wxSQLite3ResultSet& res);
};

/**
 * \class GetCostEvolutionByProject
 */
struct GetCostEvolutionByProject : public ICriteria
{
	db::ID        id_project;
	CostEvolution m_evolution;
	
	static const char* QUERY;
	
	GetCostEvolutionByProject(const db::ID& idProject);
	
	virtual bool query(wxSQLite3Database& db);
};

} // namespace pm

#endif // PM_COST_EVOLUTION_H_INCLUDED
